package lumis.portal.sendmail;

import lumis.portal.PortalException;
import lumis.portal.stability.StableMinor;

/**
 * Defines methods used by {@link MailQueueProcessThread} and {@link SendMailThread} 
 * for callback operations.
 * 
 * @since 4.0.4
 * @version $Revision: 13082 $ $Date: 2011-05-27 16:03:12 -0300 (Fri, 27 May 2011) $
 */
@StableMinor(version = "6.0", sinceVersion = "4.0")
interface IMailQueueProcessThreadCallback
{
	/**
	 * Method called by the {@link MailQueueProcessThread} to indicate that it has 
	 * terminated its processing.
	 * @param queueId the id of the mail queue the thread was responsible to process.
	 * @since 4.0.4
	 */
	public void threadTerminated(String queueId);
	
	/**
	 * Gets the next queued mail and process it.
	 * @param queueId the id of the mail queue to be processed. 
	 * @return true if there was a mail to process, false if there was no mail in the queue to process.
	 * @throws PortalException if it was not possible to process the mail queue.
	 * @since 4.0.4
	 */
	public boolean processNextQueuedMail(String queueId) throws PortalException;	
}